<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="java.util.*,java.io.*,java.sql.*,java.text.*, dbAccess.*"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="dbAccess.DbAccess;"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content
-Type" content="text/html; charset=ISO-8859-1" />
<title>Patient Home</title>
<link rel="stylesheet" type="text/css" href="css_files/style.css" />
<script type="text/javascript">
function changeNumberofDays()
{
	var mylist = document.forms["frmApptSearch"].cmbMonth;
	var month = mylist.selectedIndex;
	if ((month == 0) || (month == 2) || (month == 4) || (month == 6) || (month == 7) || (month == 9) || (month == 11))
	{
		var days = document.forms["frmApptSearch"].cmbDate;
		days.options.length = 0;
		var i = 1;
		for (i = 1; i <= 31; i++)
		{
			var opt = document.createElement("option");
			days.options.add(opt);
			opt.text = i;
			opt.value = i;
		}
	}
	else if (month == 1)
	{
		var days = document.forms["frmApptSearch"].cmbDate;
		days.options.length = 0;
		var i = 1;
		for (i = 1; i <= 28; i++)
		{
			var opt = document.createElement("option");
			days.options.add(opt);
			opt.text = i;
			opt.value = i;
		}
	}
	else
	{
		var days = document.forms["frmApptSearch"].cmbDate;
		days.options.length = 0;
		var i = 1;
		for (i = 1; i <= 30; i++)
		{
			var opt = document.createElement("option");
			days.options.add(opt);
			opt.text = i;
			opt.value = i;
		}
	}
}
	
</script>
</head>
<body>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td width="150" height="125" valign="top"><img src="images/caduceus.gif" alt="" name="LogoLeft" width="150" height="125" id="LogoLeft" style="background-color: #0033FF" /></td>
    <td width="692" align="center" valign="middle"><h1 align="center">CADUCEUS HOSPITAL</h1></td>
    <td width="157" valign="top"><img src="images/hospital.jpg" alt="" name="LogoRight" width="150" height="125" id="LogoRight" style="background-color: #0033FF" /></td>
  </tr>
  <tr>
    <td height="19" colspan="2" valign="top">Welcome <%=session.getAttribute("Name")%>&nbsp;<%=new java.util.Date() %></td>
    <td align="right">
		<a href="home.jsp" title="Logout">Logout</a>
	</td> 
  </tr>
</table>

<table width="100%" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" class="style2"><p><strong>Quicklinks</strong></p>
    <p><a href="patient2appt.jsp">View My Appointments</a></p>
    <p><a href="editPatient.jsp?callerId=patientHome">Change my Personal Information</a></p>
    <p><a href="http://www.webmd.com">WebMD</a></p>
    <p><a href="patientHome.jsp">Back to Homepage</a></p>
    <p>&nbsp;</p></td>
    <td  class="style2", valign="top"><h3><span class="style2" ><strong>Patient Personal Information</strong></span>
        <%
		Login lgn = new Login();
		ResultSet rs;
		int patientId = 0;
		String gender = "unknown";
		int healthCard = 0;
		String currentHealth = "unknown";
		String defaultDocName = "unknown";
		int docId = 0;
		
		rs = lgn.getPatientInfo(Integer.parseInt(session.getAttribute("SIN").toString()));
		if (rs != null)
		{
			while (rs.next())
			{
				patientId = rs.getInt("tbl_patient.PatientId");
				session.setAttribute("patientId",patientId); 
				gender = rs.getString("tbl_patient.Gender");
				healthCard = rs.getInt("tbl_patient.HealthCard");
				session.setAttribute("healthCard", healthCard);
				currentHealth = rs.getString("tbl_patient.CurrentHealth");
				docId = rs.getInt("tbl_patient.DocId");
				session.setAttribute("DocId", docId);
				defaultDocName = rs.getString("DocFirstName") + " " + rs.getString("DocLastName");
			}
		}
	%>
    </h3>
    <table width="648" border="1">
    	<tr>
			<td width="117">
			<strong>Patient ID:</strong>			</td>
			<td width="519">
			<%=session.getAttribute("patientId")%>			</td>
		</tr>
		<tr>
			<td width="117">
			<strong>First Name:</strong>			</td>
			<td width="519">
			<%=session.getAttribute("FirstName")%>			</td>
		</tr>
				
		<tr>
			<td width="117">
			<strong>Last Name:</strong>			</td>
			<td width="519">
			<%=session.getAttribute("LastName")%>			</td>
		</tr>
	
		<tr>
			<td width="117">
			<strong>Phone Number:</strong>			</td>
			<td width="519">
			<%=session.getAttribute("Phone")%>			</td>
		</tr>
		<tr>
			<td width="117">
			<strong>Home Address:</strong>			</td>
			<td width="519">
			<%=session.getAttribute("HomeAddress")%>			</td>
		</tr>
		<tr>
			<td width="117">
			<strong>Email Address:</strong>			</td>
			<td width="519">
			<%=session.getAttribute("EmailAddress")%>			</td>
		</tr>
			<tr>
			<td width="117">
			<strong>Gender:</strong>			</td>
			<td width="519">
			<%=gender%>			</td>
		</tr>
		<tr>
			<td width="117">
			<strong>Date of Birth:</strong>			</td>
			<td width="519">
			<%=session.getAttribute("DateOfBirth") %>		</td>
		</tr>	
		<tr>
			<td width="117">
			<strong>Health Card:</strong>			</td>
			<td width="519">
			<%=healthCard%>			</td>
		</tr>
		<tr>
			<td width="117">
			<strong>Primary Doctor:</strong>			</td>
			<td width="519">
			Dr. <%=defaultDocName%>			</td>
		</tr>
		<tr>
			<td width="117">
			<strong>Current Health:</strong>			</td>
			<td width="519">
			<%=currentHealth%>			</td>
		</tr>
	</table>
	</td>
	</tr>
	
  
  
  <tr>
     <td height="220" valign="top" class="style2"></td>
  </tr>
</table>
</body>



</html>